<?php
//
//	file: includes/advlog/class_advlog.php
//	begin: 30/04/2007
//	$Author: christopher $
//	$Revision: 31 $
//	$Date: 2008-07-21 03:08:30 +0000 (Mon, 21 Jul 2008) $
//	license: http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
//
//	description: pre-check for advlog

if (!defined('IN_PHPBB'))
{
	die("Hacking attempt");
}

if ( !defined('LOG_CURRENT_VERSION') )
{
	// constants
	define('LOG_CURRENT_VERSION', '1.9.0');

	// Auth (only for auth.php, in order to be able to hit regen and get back this one)
	define('AUTH_LOG_NOTIFY', 65);
	define('AUTH_LOG_VIEWIP', 67);

	// Tables
	define('LOGS_TABLE', $table_prefix . 'logs');
}

// do not go further during login or installation
if ( defined('IN_LOGIN') || defined('IN_INSTALL') )
{
	return;
}

// intall directory still present
if ( file_exists(phpbb_realpath($config->root . 'installer')) )
{
	if ( $config->data['mod_advanced_logging'] != LOG_CURRENT_VERSION )
	{
		header('Location: ' . $config->url('installer/install'));
		exit;
	}
	else
	{
		message_die(GENERAL_MESSAGE, 'Please remove installer/ directory');
	}
}

// start the loader
if ( $config->data['mod_advanced_logging'] )
{
	include($config->url('includes/advlog/class_advlog_init'));
}

?>